home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / emacs.lha / emacs-19.16 / info / emacs-12 (.txt) < prev    next >
GNU Info File  |  1993-07-06  |  49KB  |  876 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.54 from the
  2. input file emacs.texi.
  3. File: emacs,  Node: Saving Abbrevs,  Next: Dynamic Abbrevs,  Prev: Editing Abbrevs,  Up: Abbrevs
  4. Saving Abbrevs
  5. ==============
  6.    These commands allow you to keep abbrev definitions between editing
  7. sessions.
  8. `M-x write-abbrev-file'
  9.      Write a file describing all defined abbrevs.
  10. `M-x read-abbrev-file'
  11.      Read such a file and define abbrevs as specified there.
  12. `M-x quietly-read-abbrev-file'
  13.      Similar but do not display a message about what is going on.
  14. `M-x define-abbrevs'
  15.      Define abbrevs from definitions in current buffer.
  16. `M-x insert-abbrevs'
  17.      Insert all abbrevs and their expansions into current buffer.
  18.    `M-x write-abbrev-file' reads a file name using the minibuffer and
  19. writes a description of all current abbrev definitions into that file.
  20. The text stored in the file looks like the output of `M-x list-abbrevs'.
  21. This is used to save abbrev definitions for use in a later session.
  22.    `M-x read-abbrev-file' reads a file name using the minibuffer and
  23. reads the file, defining abbrevs according to the contents of the file.
  24. `M-x quietly-read-abbrev-file' is the same except that it does not
  25. display a message in the echo area saying that it is doing its work; it
  26. is actually useful primarily in the `.emacs' file.  If an empty
  27. argument is given to either of these functions, the file name used is
  28. the value of the variable `abbrev-file-name', which is by default
  29. `"~/.abbrev_defs"'.
  30.    Emacs will offer to save abbrevs automatically if you have changed
  31. any of them, whenever it offers to save all files (for `C-x s' or `C-x
  32. C-c').  This feature can be inhibited by setting the variable
  33. `save-abbrevs' to `nil'.
  34.    The commands `M-x insert-abbrevs' and `M-x define-abbrevs' are
  35. similar to the previous commands but work on text in an Emacs buffer.
  36. `M-x insert-abbrevs' inserts text into the current buffer before point,
  37. describing all current abbrev definitions; `M-x define-abbrevs' parses
  38. the entire current buffer and defines abbrevs accordingly.
  39. File: emacs,  Node: Dynamic Abbrevs,  Prev: Saving Abbrevs,  Up: Abbrevs
  40. Dynamic Abbrev Expansion
  41. ========================
  42.    The abbrev facility described above operates automatically as you
  43. insert text, but all abbrevs must be defined explicitly.  By contrast,
  44. "dynamic abbrevs" allow the meanings of abbrevs to be determined
  45. automatically from the contents of the buffer, but dynamic abbrev
  46. expansion happens only when you request it explicitly.
  47. `M-/'
  48.      Expand the word in the buffer before point as a "dynamic abbrev",
  49.      by searching in the buffer for words starting with that
  50.      abbreviation (`dabbrev-expand').
  51.    For example, if the buffer contains `does this follow ' and you type
  52. `f o M-/', the effect is to insert `follow' because that is the last
  53. word in the buffer that starts with `fo'.  A numeric argument to `M-/'
  54. says to take the second, third, etc. distinct expansion found looking
  55. backward from point.  Repeating `M-/' searches for an alternative
  56. expansion by looking farther back.  After the entire buffer before
  57. point has been considered, the buffer after point is searched.
  58.    Dynamic abbrev expansion is completely independent of Abbrev mode;
  59. the expansion of a word with `M-/' is completely independent of whether
  60. it has a definition as an ordinary abbrev.
  61. File: emacs,  Node: Picture,  Next: Sending Mail,  Prev: Abbrevs,  Up: Top
  62. Editing Pictures
  63. ****************
  64.    If you want to create a picture made out of text characters (for
  65. example, a picture of the division of a register into fields, as a
  66. comment in a program), use the command `M-x edit-picture' to enter
  67. Picture mode.
  68.    In Picture mode, editing is based on the "quarter-plane" model of
  69. text, according to which the text characters lie studded on an area that
  70. stretches infinitely far to the right and downward.  The concept of the
  71. end of a line does not exist in this model; the most you can say is
  72. where the last nonblank character on the line is found.
  73.    Of course, Emacs really always considers text as a sequence of
  74. characters, and lines really do have ends.  But in Picture mode most
  75. frequently-used keys are rebound to commands that simulate the
  76. quarter-plane model of text.  They do this by inserting spaces or by
  77. converting tabs to spaces.
  78.    Most of the basic editing commands of Emacs are redefined by Picture
  79. mode to do essentially the same thing but in a quarter-plane way.  In
  80. addition, Picture mode defines various keys starting with the `C-c'
  81. prefix to run special picture editing commands.
  82.    One of these keys, `C-c C-c', is pretty important.  Often a picture
  83. is part of a larger file that is usually edited in some other major
  84. mode.  `M-x edit-picture' records the name of the previous major mode
  85. so you can use the `C-c C-c' command (`picture-mode-exit') later to go
  86. back to that mode.  `C-c C-c' also deletes spaces from the ends of
  87. lines, unless given a numeric argument.
  88.    The commands used in Picture mode all work in other modes (provided
  89. the `picture' library is loaded), but are not bound to keys except in
  90. Picture mode.  Note that the descriptions below talk of moving "one
  91. column" and so on, but all the picture mode commands handle numeric
  92. arguments as their normal equivalents do.
  93.    Turning on Picture mode runs the hook `picture-mode-hook' (*note
  94. Hooks::.).
  95. * Menu:
  96. * Basic Picture::         Basic concepts and simple commands of Picture Mode.
  97. * Insert in Picture::     Controlling direction of cursor motion
  98.                             after "self-inserting" characters.
  99. * Tabs in Picture::       Various features for tab stops and indentation.
  100. * Rectangles in Picture:: Clearing and superimposing rectangles.
  101. File: emacs,  Node: Basic Picture,  Next: Insert in Picture,  Prev: Picture,  Up: Picture
  102. Basic Editing in Picture Mode
  103. =============================
  104.    Most keys do the same thing in Picture mode that they usually do, but
  105. do it in a quarter-plane style.  For example, `C-f' is rebound to run
  106. `picture-forward-column', a command which moves point one column to the
  107. right, inserting a space if necessary so that the actual end of the
  108. line makes no difference.  `C-b' is rebound to run
  109. `picture-backward-column', which always moves point left one column,
  110. converting a tab to multiple spaces if necessary.  `C-n' and `C-p' are
  111. rebound to run `picture-move-down' and `picture-move-up', which can
  112. either insert spaces or convert tabs as necessary to make sure that
  113. point stays in exactly the same column.  `C-e' runs
  114. `picture-end-of-line', which moves to after the last nonblank character
  115. on the line.  There is no need to change `C-a', as the choice of screen
  116. model does not affect beginnings of lines.
  117.    Insertion of text is adapted to the quarter-plane screen model
  118. through the use of Overwrite mode (*note Minor Modes::.).
  119. Self-inserting characters replace existing text, column by column,
  120. rather than pushing existing text to the right.  RET runs
  121. `picture-newline', which just moves to the beginning of the following
  122. line so that new text will replace that line.
  123.    Picture mode provides erasure instead of deletion and killing of
  124. text.  DEL (`picture-backward-clear-column') replaces the preceding
  125. character with a space rather than removing it; this moves point
  126. backwards.  `C-d' (`picture-clear-column') replaces the next character
  127. or characters with spaces, but does not move point.  (If you want to
  128. clear characters to spaces and move forward over them, use SPC.)  `C-k'
  129. (`picture-clear-line') really kills the contents of lines, but does not
  130. delete the newlines from the buffer.
  131.    To do actual insertion, you must use special commands.  `C-o'
  132. (`picture-open-line') still creates a blank line, but does so after the
  133. current line; it never splits a line.  `C-M-o', `split-line', makes
  134. sense in Picture mode, so it is not changed.  LFD
  135. (`picture-duplicate-line') inserts below the current line another line
  136. with the same contents.
  137.    If you want to do real deletion in Picture mode, use `C-w', `C-c
  138. C-d' (which is defined as `delete-char', as `C-d' is in other modes),
  139. or one of the picture rectangle commands (*note Rectangles in
  140. Picture::.).
  141. File: emacs,  Node: Insert in Picture,  Next: Tabs in Picture,  Prev: Basic Picture,  Up: Picture
  142. Controlling Motion after Insert
  143. ===============================
  144.    Since "self-inserting" characters in Picture mode just overwrite and
  145. move point, there is no essential restriction on how point should be
  146. moved.  Normally point moves right, but you can specify any of the
  147. eight orthogonal or diagonal directions for motion after a
  148. "self-inserting" character.  This is useful for drawing lines in the
  149. buffer.
  150. `C-c <'
  151.      Move left after insertion (`picture-movement-left').
  152. `C-c >'
  153.      Move right after insertion (`picture-movement-right').
  154. `C-c ^'
  155.      Move up after insertion (`picture-movement-up').
  156. `C-c .'
  157.      Move down after insertion (`picture-movement-down').
  158. `C-c `'
  159.      Move up and left ("northwest") after insertion
  160.      (`picture-movement-nw').
  161. `C-c ''
  162.      Move up and right ("northeast") after insertion
  163.      (`picture-movement-ne').
  164. `C-c /'
  165.      Move down and left ("southwest") after insertion
  166.      (`picture-movement-sw').
  167. `C-c \'
  168.      Move down and right ("southeast") after insertion
  169.      (`picture-movement-se').
  170.    Two motion commands move based on the current Picture insertion
  171. direction.  The command `C-c C-f' (`picture-motion') moves in the same
  172. direction as motion after "insertion" currently does, while `C-c C-b'
  173. (`picture-motion-reverse') moves in the opposite direction.
  174. File: emacs,  Node: Tabs in Picture,  Next: Rectangles in Picture,  Prev: Insert in Picture,  Up: Picture
  175. Picture Mode Tabs
  176. =================
  177.    Two kinds of tab-like action are provided in Picture mode.  Use
  178. `M-TAB' (`picture-tab-search') for context-based tabbing.  With no
  179. argument, it moves to a point underneath the next "interesting"
  180. character that follows whitespace in the previous nonblank line.
  181. "Next" here means "appearing at a horizontal position greater than the
  182. one point starts out at".  With an argument, as in `C-u M-TAB', this
  183. command moves to the next such interesting character in the current
  184. line.  `M-TAB' does not change the text; it only moves point.
  185. "Interesting" characters are defined by the variable
  186. `picture-tab-chars', which contains a string whose characters are all
  187. considered interesting.  Its default value is `"!-~"'.
  188.    TAB itself runs `picture-tab', which operates based on the current
  189. tab stop settings; it is the Picture mode equivalent of
  190. `tab-to-tab-stop'.  Normally it just moves point, but with a numeric
  191. argument it clears the text that it moves over.
  192.    The context-based and tab-stop-based forms of tabbing are brought
  193. together by the command `C-c TAB', `picture-set-tab-stops'.  This
  194. command sets the tab stops to the positions which `M-TAB' would
  195. consider significant in the current line.  The use of this command,
  196. together with TAB, can get the effect of context-based tabbing.  But
  197. `M-TAB' is more convenient in the cases where it is sufficient.
  198. File: emacs,  Node: Rectangles in Picture,  Prev: Tabs in Picture,  Up: Picture
  199. Picture Mode Rectangle Commands
  200. ===============================
  201.    Picture mode defines commands for working on rectangular pieces of
  202. the text in ways that fit with the quarter-plane model.  The standard
  203. rectangle commands may also be useful (*note Rectangles::.).
  204. `C-c C-k'
  205.      Clear out the region-rectangle (`picture-clear-rectangle').  With
  206.      argument, kill it.
  207. `C-c C-w R'
  208.      Similar but save rectangle contents in register R first
  209.      (`picture-clear-rectangle-to-register').
  210. `C-c C-y'
  211.      Copy last killed rectangle into the buffer by overwriting, with
  212.      upper left corner at point (`picture-yank-rectangle').  With
  213.      argument, insert instead.
  214. `C-c C-x R'
  215.      Similar, but use the rectangle in register R
  216.      (`picture-yank-rectangle-from-register').
  217.    The picture rectangle commands `C-c C-k' (`picture-clear-rectangle')
  218. and `C-c C-w' (`picture-clear-rectangle-to-register') differ from the
  219. standard rectangle commands in that they normally clear the rectangle
  220. instead of deleting it; this is analogous with the way `C-d' is changed
  221. in Picture mode.
  222.    However, deletion of rectangles can be useful in Picture mode, so
  223. these commands delete the rectangle if given a numeric argument.
  224.    The Picture mode commands for yanking rectangles differ from the
  225. standard ones in overwriting instead of inserting.  This is the same way
  226. that Picture mode insertion of other text differs from other modes.
  227. `C-c C-y' (`picture-yank-rectangle') inserts (by overwriting) the
  228. rectangle that was most recently killed, while `C-c C-x'
  229. (`picture-yank-rectangle-from-register') does likewise for the
  230. rectangle found in a specified register.
  231. File: emacs,  Node: Sending Mail,  Next: Rmail,  Prev: Picture,  Up: Top
  232. Sending Mail
  233. ************
  234.    To send a message in Emacs, you start by typing a command (`C-x m')
  235. to select and initialize the `*mail*' buffer.  Then you edit the text
  236. and headers of the message in this buffer, and type another command
  237. (`C-c C-c') to send the message.
  238. `C-x m'
  239.      Begin composing a message to send (`mail').
  240. `C-x 4 m'
  241.      Likewise, but display the message in another window
  242.      (`mail-other-window').
  243. `C-x 5 m'
  244.      Likewise, but make a new frame (`mail-other-frame').
  245. `C-c C-c'
  246.      In Mail mode, send the message and switch to another buffer
  247.      (`mail-send-and-exit').
  248.    The command `C-x m' (`mail') selects a buffer named `*mail*' and
  249. initializes it with the skeleton of an outgoing message.  `C-x 4 m'
  250. (`mail-other-window') selects the `*mail*' buffer in a different
  251. window, leaving the previous current buffer visible.  `C-x 5 m'
  252. (`mail-other-frame') creates a new frame to select the `*mail*' buffer.
  253.    Because the mail composition buffer is an ordinary Emacs buffer, you
  254. can switch to other buffers while in the middle of composing mail, and
  255. switch back later (or never).  If you use the `C-x m' command again
  256. when you have been composing another message but have not sent it, you
  257. are asked to confirm before the old message is erased.  If you answer
  258. `n', the `*mail*' buffer is left selected with its old contents, so you
  259. can finish the old message and send it.  `C-u C-x m' is another way to
  260. do this.  Sending the message marks the `*mail*' buffer "unmodified",
  261. which avoids the need for confirmation when `C-x m' is next used.
  262.    If you are composing a message in the `*mail*' buffer and want to
  263. send another message before finishing the first, rename the `*mail*'
  264. buffer using `M-x rename-uniquely' (*note Misc Buffer::.).  Then you
  265. can use `C-x m' or its variants described above to make a new `*mail'
  266. buffer.  Once you've done that, you can work with each mail buffer
  267. independently.
  268. * Menu:
  269. * Format: Mail Format.     Format of the mail being composed.
  270. * Headers: Mail Headers.   Details of permitted mail header fields.
  271. * Aliases: Mail Aliases.   Abbreviating and grouping mail addresses.
  272. * Mode: Mail Mode.         Special commands for editing mail being composed.
  273. * Spook: Distracting NSA.  How to distract the NSA's attention.
  274. File: emacs,  Node: Mail Format,  Next: Mail Headers,  Up: Sending Mail
  275. The Format of the Mail Buffer
  276. =============================
  277.    In addition to the "text" or "body", a message has "header fields"
  278. which say who sent it, when, to whom, why, and so on.  Some header
  279. fields such as the date and sender are created automatically after the
  280. message is sent.  Others, such as the recipient names, must be
  281. specified by you in order to send the message properly.
  282.    Mail mode provides a few commands to help you edit some header
  283. fields, and some are preinitialized in the buffer automatically at
  284. times.  You can insert or edit any header fields using ordinary editing
  285. commands.
  286.    The line in the buffer that says
  287.      --text follows this line--
  288. is a special delimiter that separates the headers you have specified
  289. from the text.  Whatever follows this line is the text of the message;
  290. the headers precede it.  The delimiter line itself does not appear in
  291. the message actually sent.  The text used for the delimiter line is
  292. controlled by the variable `mail-header-separator'.
  293.    Here is an example of what the headers and text in the `*mail*'
  294. buffer might look like.
  295.      To: gnu@prep.ai.mit.edu
  296.      CC: lungfish@spam.org, byob@spam.org
  297.      Subject: The Emacs Manual
  298.      --Text follows this line--
  299.      Please ignore this message.
  300. File: emacs,  Node: Mail Headers,  Next: Mail Aliases,  Prev: Mail Format,  Up: Sending Mail
  301. Mail Header Fields
  302. ==================
  303.    There are several header fields you can use in the `*mail*' buffer.
  304. Each header field starts with a field name at the beginning of a line,
  305. terminated by a colon.  Upper and lower case are equivalent in field
  306. names (and in mailing addresses also).  After the colon and optional
  307. whitespace comes the contents of the field.
  308.      This field contains the mailing addresses to which the message is
  309.      addressed.
  310. `Subject'
  311.      The contents of the `Subject' field should be a piece of text that
  312.      says what the message is about.  The reason `Subject' fields are
  313.      useful is that most mail-reading programs can provide a summary of
  314.      messages, listing the subject of each message but not its text.
  315.      This field contains additional mailing addresses to send the
  316.      message to, but whose readers should not regard the message as
  317.      addressed to them.
  318. `BCC'
  319.      This field contains additional mailing addresses to send the
  320.      message to, which should not appear in the header of the message
  321.      actually sent.  Copies sent this way are called "blind carbon
  322.      copies".
  323.      To send a blind carbon copy of every outgoing message to yourself,
  324.      set the variable `mail-self-blind' to `t'.
  325. `FCC'
  326.      This field contains the name of one file (in system mail file
  327.      format) to which a copy of the message should be appended when the
  328.      message is sent.  Do not output directly into an Rmail file with
  329.      FCC; instead, output to an inbox file and "get new mail" from that
  330.      inbox file into the Rmail file.  *Note Rmail Inbox::.
  331. `From'
  332.      Use the `From' field to say who you are, when the account you are
  333.      using to send the mail is not your own.  The contents of the
  334.      `From' field should be a valid mailing address, since replies will
  335.      normally go there.
  336. `Reply-to'
  337.      Use this field to direct replies to a different address.  Most
  338.      mail-reading programs (including Rmail) automatically send replies
  339.      to the `Reply-to' address in preference to the `From' address.  By
  340.      adding a `Reply-to' field to your header, you can work around any
  341.      problems your `From' address may cause for replies.
  342.      If you want to put the same `Reply-to' address into every outgoing
  343.      message, set the variable `mail-default-reply-to' to that address
  344.      (as a string).
  345. `In-reply-to'
  346.      This field contains a piece of text describing a message you are
  347.      replying to.  Some mail systems can use this information to
  348.      correlate related pieces of mail.  Normally this field is filled
  349.      in by Rmail when you are replying to a message in Rmail, and you
  350.      never need to think about it (*note Rmail::.).
  351. The `To', `CC', `BCC' and `FCC' fields can appear any number of times,
  352. to specify many places to send the message.
  353. The `To', `CC', and `BCC' fields can have continuation lines.  All the
  354. lines starting with whitespace, following the line on which the field
  355. starts, are considered part of the field.  For example,
  356.      To: foo@here.net, this@there.net,
  357.        me@gnu.cambridge.mass.usa.earth.spiral3281
  358.    If the variable `mail-archive-file-name' is non-`nil', it should be
  359. a string naming a file; every time you start to edit a message to send,
  360. the message starts out with an `FCC' field specifying that file.
  361. Unless you remove the `FCC' field before sending, the message will be
  362. written into that file when it is sent.
  363. File: emacs,  Node: Mail Aliases,  Next: Mail Mode,  Prev: Mail Headers,  Up: Sending Mail
  364. Mail Aliases
  365. ============
  366.    You can define "mail aliases" in a file named `~/.mailrc'.  These
  367. are short mnemonic names stand for mail addresses or groups of mail
  368. addresses.  Like many other mail programs, Emacs expands aliases when
  369. they occur in the `To', `CC', and `BCC' fields.
  370.    To define an alias in `~/.mailrc', write a line in the following
  371. format:
  372.      alias SHORTADDRESS FULLADDRESS
  373. For instance, if you send want to use `maingnu' as a short form of the
  374. address `gnu@prep.ai.mit.edu', put in the line:
  375.      alias maingnu gnu@prep.ai.mit.edu
  376. The file `~/.mailrc' is used primarily by other mail-reading programs;
  377. it can contain various other commands.  Emacs ignores everything in it
  378. except for alias definitions.
  379.    Another way to define a mail alias, within Emacs alone, is with the
  380. `define-mail-alias' command.  It prompts for the alias and then the
  381. full address.  You can use it to define aliases in your `.emacs' file,
  382. like this:
  383.      (define-mail-alias "maingnu" "gnu@prep.ai.mit.edu")
  384.    `define-mail-alias' records aliases by adding them to a variable
  385. named `mail-aliases'.  If your are comfortable with manipulating Lisp
  386. lists, you can set `mail-aliases' directly.  The initial value of
  387. `mail-aliases' is `t', which means that Emacs should read `.mailrc' to
  388. get the proper value.
  389.    Normally, Emacs expands aliases when you send the message.  If you
  390. like, you can have mail aliases expand as abbrevs, as soon as you type
  391. them in.  To enable this feature, execute the following:
  392.      (add-hook 'mail-setup-hook 'mail-abbrevs-setup)
  393. This can go in your `.emacs' file.  *Note Hooks::.
  394.    Note that abbrevs expand only if you insert a word-separator
  395. character afterward.  However, any mail aliases that you didn't expand
  396. in the mail buffer are expanded subsequently when you send the message.
  397. *Note Abbrevs::.
  398. File: emacs,  Node: Mail Mode,  Next: Distracting NSA,  Prev: Mail Aliases,  Up: Sending Mail
  399. Mail Mode
  400. =========
  401.    The major mode used in the `*mail*' buffer is Mail mode, which is
  402. much like Text mode except that various special commands are provided on
  403. the `C-c' prefix.  These commands all have to do specifically with
  404. editing or sending the message.
  405. `C-c C-s'
  406.      Send the message, and leave the `*mail*' buffer selected
  407.      (`mail-send').
  408. `C-c C-c'
  409.      Send the message, and select some other buffer
  410.      (`mail-send-and-exit').
  411. `C-c C-f C-t'
  412.      Move to the `To' header field, creating one if there is none
  413.      (`mail-to').
  414. `C-c C-f C-s'
  415.      Move to the `Subject' header field, creating one if there is none
  416.      (`mail-subject').
  417. `C-c C-f C-c'
  418.      Move to the `CC' header field, creating one if there is none
  419.      (`mail-cc').
  420. `C-c C-w'
  421.      Insert the file `~/.signature' at the end of the message text
  422.      (`mail-signature').
  423. `C-c C-y'
  424.      Yank the selected message from Rmail (`mail-yank-original').  This
  425.      command does nothing unless your command to start sending a
  426.      message was issued with Rmail.
  427. `C-c C-q'
  428.      Fill all paragraphs of yanked old messages, each individually
  429.      (`mail-fill-yanked-message').
  430.    There are two ways to send the message.  `C-c C-s' (`mail-send')
  431. sends the message and marks the `*mail*' buffer unmodified, but leaves
  432. that buffer selected so that you can modify the message (perhaps with
  433. new recipients) and send it again.  `C-c C-c' (`mail-send-and-exit')
  434. sends and then deletes the window or switches to another buffer.  It
  435. puts the `*mail*' buffer at the lowest priority for reselection by
  436. default, since you are finished with using it.  This is the usual way
  437. to send the message.
  438.    Mail mode provides some other special commands that are useful for
  439. editing the headers and text of the message before you send it.  There
  440. are three commands defined to move point to particular header fields,
  441. all based on the prefix `C-c C-f' (`C-f' is for "field").  They are
  442. `C-c C-f C-t' (`mail-to') to move to the `To' field, `C-c C-f C-s'
  443. (`mail-subject') for the `Subject' field, and `C-c C-f C-c' (`mail-cc')
  444. for the `CC' field.  These fields have special motion commands because
  445. they are the most common fields for the user to want to edit.
  446.    `C-c C-w' (`mail-signature') adds a standard piece text at the end
  447. of the message to say more about who you are.  The text comes from the
  448. file `.signature' in your home directory.
  449.    To insert signatures automatically, set the variable
  450. `mail-signature' non-`nil'; then starting a mail message automatically
  451. inserts the contents of your `.signature' file.  If you want to omit
  452. your signature from a particular message, delete it from the buffer
  453. before you send the message.
  454.    When mail sending is invoked from the Rmail mail reader using an
  455. Rmail command, `C-c C-y' can be used inside the `*mail*' buffer to
  456. insert the text of the message you are replying to.  Normally it
  457. indents each line of that message four spaces and eliminates most
  458. header fields.  A numeric argument specifies the number of spaces to
  459. indent.  An argument of just `C-u' says not to indent at all and not to
  460. eliminate anything.  `C-c C-y' always uses the current message from the
  461. `RMAIL' buffer, so you can insert several old messages by selecting one
  462. in `RMAIL', switching to `*mail*' and yanking it, then switching back to
  463. `RMAIL' to select another.
  464.    You can specify the text for `C-c C-y' to insert at the beginning of
  465. each line: set `mail-yank-prefix' to the desired string.  (A value of
  466. `nil' means to use indentation; this is the default.) However, `C-u C-c
  467. C-y' never adds anything at the beginning of the inserted lines,
  468. regardless of the value of `mail-yank-prefix'.
  469.    After using `C-c C-y', you can use the command `C-c C-q'
  470. (`mail-fill-yanked-message') to fill the paragraphs of the yanked old
  471. message or messages.  One use of `C-c C-q' fills all such paragraphs,
  472. each one individually.
  473.    Mail mode defines the character `%' as part of a word; this is
  474. helpful for using the word commands to edit mail addresses.
  475.    Turning on Mail mode (which `C-x m' does automatically) runs the
  476. normal hooks `text-mode-hook' and `mail-mode-hook'.  Initializing a new
  477. outgoing message runs the normal hook `mail-setup-hook'; if you want to
  478. add special fields to your mail header or make other changes to the
  479. appearance of the mail buffer, use that hook.  *Note Hooks::.
  480.    The main difference between these hooks is just when they are
  481. invoked.  Whenever you type `M-x mail', `mail-mode-hook' runs as soon
  482. as the `*mail*' buffer is created.  Then the `mail-setup' function puts
  483. in the default contents of the buffer.  After these default contents
  484. are inserted, `mail-setup-hook' runs.
  485. File: emacs,  Node: Distracting NSA,  Prev: Mail Mode,  Up: Sending Mail
  486. Distracting the NSA
  487. ===================
  488.    `M-x spook' adds a line of randomly chosen keywords to an outgoing
  489. mail message.  The keywords are chosen from a list of words that suggest
  490. you are discussing something subversive.
  491.    The idea behind this feature is that the suspicion that the NSA
  492. snoops on all electronic mail messages that contain keywords suggesting
  493. they might be interested.  (The NSA says they don't, but there is no
  494. way to be certain.)  The idea is that if lots of people add suspicious
  495. words to their messages, the NSA will get so busy with spurious input
  496. that they will have to give up reading it all.
  497.    Whether or not this confuses the NSA, it at least amuses people.
  498. File: emacs,  Node: Rmail,  Next: Dired,  Prev: Sending Mail,  Up: Top
  499. Reading Mail with Rmail
  500. ***********************
  501.    Rmail is an Emacs subsystem for reading and disposing of mail that
  502. you receive.  Rmail stores mail messages in files called Rmail files.
  503. Reading the message in an Rmail file is done in a special major mode,
  504. Rmail mode, which redefines most letters to run commands for managing
  505. mail.  To enter Rmail, type `M-x rmail'.  This reads your primary mail
  506. file, merges new mail in from your inboxes, displays the first message
  507. you haven't read yet, and lets you begin reading.
  508.    Using Rmail in the simplest fashion, you have one Rmail file
  509. `~/RMAIL' in which all of your mail is saved.  It is called your
  510. "primary mail file".  In more sophisticated usage, you can copy
  511. messages into other Rmail files and then edit those files with Rmail.
  512.    Rmail uses narrowing to hide all but one message in the Rmail file.
  513. The message that is shown is called the "current message".  Rmail
  514. mode's special commands can do such things as delete the current
  515. message, copy into another file, send a reply, or move to another
  516. message.
  517.    Within the Rmail file, messages are arranged sequentially in order
  518. of receipt.  They are also assigned consecutive integers as their
  519. "message numbers".  The number of the current message is displayed in
  520. Rmail's mode line, followed by the total number of messages in the
  521. file.  You can move to a message by specifying its message number using
  522. the `j' key (*note Rmail Motion::.).
  523.    Following the usual conventions of Emacs, changes in an Rmail file
  524. become permanent only when the file is saved.  You can do this with `s'
  525. (`rmail-save'), which also expunges deleted messages from the file
  526. first (*note Rmail Deletion::.).  To save the file without expunging,
  527. use `C-x C-s'.  Rmail saves the Rmail file spontaneously when moving new
  528. mail from an inbox file (*note Rmail Inbox::.).
  529.    You can exit Rmail with `q' (`rmail-quit'); this expunges and saves
  530. the Rmail file and then switches to another buffer.  But there is no
  531. need to `exit' formally.  If you switch from Rmail to editing in other
  532. buffers, and never happen to switch back, you have exited.  (The Rmail
  533. command `b', `rmail-bury', does this for you.)  Just make sure to save
  534. the Rmail file eventually (like any other file you have changed).  `C-x
  535. s' is a good enough way to do this (*note Saving::.).
  536. * Menu:
  537. * Scroll: Rmail Scrolling.   Scrolling through a message.
  538. * Motion: Rmail Motion.      Moving to another message.
  539. * Deletion: Rmail Deletion.  Deleting and expunging messages.
  540. * Inbox: Rmail Inbox.        How mail gets into the Rmail file.
  541. * Files: Rmail Files.        Using multiple Rmail files.
  542. * Output: Rmail Output.         Copying message out to files.
  543. * Labels: Rmail Labels.      Classifying messages by labeling them.
  544. * Reply: Rmail Reply.        Sending replies to messages you are viewing.
  545. * Summary: Rmail Summary.    Summaries show brief info on many messages.
  546. * Editing: Rmail Editing.    Editing message text and headers in Rmail.
  547. * Digest: Rmail Digest.      Extracting the messages from a digest message.
  548. * Out of Rmail::         Converting an Rmail file to mailbox format.
  549. * Rot13: Rmail Rot13.         Reading messages encoded in the rot13 code.
  550. File: emacs,  Node: Rmail Scrolling,  Next: Rmail Motion,  Up: Rmail
  551. Scrolling Within a Message
  552. ==========================
  553.    When Rmail displays a message that does not fit on the screen, it is
  554. necessary to scroll through it.  This could be done with `C-v', `M-v'
  555. and `M-<', but in Rmail scrolling is so frequent that it deserves to be
  556. easier to type.
  557. `SPC'
  558.      Scroll forward (`scroll-up').
  559. `DEL'
  560.      Scroll backward (`scroll-down').
  561.      Scroll to start of message (`rmail-beginning-of-message').
  562.    Since the most common thing to do while reading a message is to
  563. scroll through it by screenfuls, Rmail makes SPC and DEL synonyms of
  564. `C-v' (`scroll-up') and `M-v' (`scroll-down')
  565.    The command `.' (`rmail-beginning-of-message') scrolls back to the
  566. beginning of the selected message.  This is not quite the same as `M-<':
  567. for one thing, it does not set the mark; for another, it resets the
  568. buffer boundaries to the current message if you have changed them.
  569. File: emacs,  Node: Rmail Motion,  Next: Rmail Deletion,  Prev: Rmail Scrolling,  Up: Rmail
  570. Moving Among Messages
  571. =====================
  572.    The most basic thing to do with a message is to read it.  The way to
  573. do this in Rmail is to make the message current.  The usual practice is
  574. to move sequentially through the file, since this is the order of
  575. receipt of messages.  When you enter Rmail, you are positioned at the
  576. first message that you have not yet made current (that is, the first one
  577. that has the `unseen' attribute; *note Rmail Labels::.).  Move forward
  578. to see the other new messages; move backward to reexamine old messages.
  579.      Move to the next nondeleted message, skipping any intervening
  580.      deleted
  581.      messages (`rmail-next-undeleted-message').
  582.      Move to the previous nondeleted message
  583.      (`rmail-previous-undeleted-message').
  584. `M-n'
  585.      Move to the next message, including deleted messages
  586.      (`rmail-next-message').
  587. `M-p'
  588.      Move to the previous message, including deleted messages
  589.      (`rmail-previous-message').
  590.      Move to the first message.  With argument N, move to message
  591.      number N (`rmail-show-message').
  592.      Move to the last message (`rmail-last-message').
  593.      Move to the first message (`rmail-first-message').
  594. `M-s REGEXP RET'
  595.      Move to the next message containing a match for REGEXP
  596.      (`rmail-search').
  597. `- M-s REGEXP RET'
  598.      Move to the previous message containing a match for REGEXP.
  599.    `n' and `p' are the usual way of moving among messages in Rmail.
  600. They move through the messages sequentially, but skip over deleted
  601. messages, which is usually what you want to do.  Their command
  602. definitions are named `rmail-next-undeleted-message' and
  603. `rmail-previous-undeleted-message'.  If you do not want to skip deleted
  604. messages--for example, if you want to move to a message to undelete
  605. it--use the variants `M-n' and `M-p' (`rmail-next-message' and
  606. `rmail-previous-message').  A numeric argument to any of these commands
  607. serves as a repeat count.
  608.    In Rmail, you can specify a numeric argument by typing just the
  609. digits.  You don't need to type `C-u' first.
  610.    The `M-s' (`rmail-search') command is Rmail's version of search.
  611. The usual incremental search command `C-s' works in Rmail, but it
  612. searches only within the current message.  The purpose of `M-s' is to
  613. search for another message.  It reads a regular expression (*note
  614. Regexps::.) nonincrementally, then searches starting at the beginning
  615. of the following message for a match.  The message containing the match
  616. is selected.
  617.    If REGEXP is empty, `M-s' reuses the regexp used the previous time.
  618.    To search backward in the file for another message, give `M-s' a
  619. negative argument.  In Rmail you can do this with `- M-s'.
  620.    It is also possible to search for a message based on labels.  *Note
  621. Rmail Labels::.
  622.    To move to a message specified by absolute message number, use `j'
  623. (`rmail-show-message') with the message number as argument.  With no
  624. argument, `j' selects the first message.  `>' (`rmail-last-message')
  625. selects the last message.  `<' (`rmail-first-message') selects the
  626. first message.
  627. File: emacs,  Node: Rmail Deletion,  Next: Rmail Inbox,  Prev: Rmail Motion,  Up: Rmail
  628. Deleting Messages
  629. =================
  630.    When you no longer need to keep a message, you can "delete" it.  This
  631. flags it as ignorable, and some Rmail commands pretend it is no longer
  632. present; but it still has its place in the Rmail file, and still has its
  633. message number.
  634.    "Expunging" the Rmail file actually removes the deleted messages.
  635. The remaining messages are renumbered consecutively.  Expunging is the
  636. only action that changes the message number of any message, except for
  637. undigestifying (*note Rmail Digest::.).
  638.      Delete the current message, and move to the next nondeleted message
  639.      (`rmail-delete-forward').
  640. `C-d'
  641.      Delete the current message, and move to the previous nondeleted
  642.      message (`rmail-delete-backward').
  643.      Undelete the current message, or move back to a deleted message and
  644.      undelete it (`rmail-undelete-previous-message').
  645.      Expunge the Rmail file (`rmail-expunge').
  646.    There are two Rmail commands for deleting messages.  Both delete the
  647. current message and select another message.  `d'
  648. (`rmail-delete-forward') moves to the following message, skipping
  649. messages already deleted, while `C-d' (`rmail-delete-backward') moves
  650. to the previous nondeleted message.  If there is no nondeleted message
  651. to move to in the specified direction, the message that was just
  652. deleted remains current.
  653.    To make all the deleted messages finally vanish from the Rmail file,
  654. type `x' (`rmail-expunge').  Until you do this, you can still
  655. "undelete" the deleted messages.
  656.    To undelete, type `u' (`rmail-undelete-previous-message'), which is
  657. designed to cancel the effect of a `d' command (usually).  It undeletes
  658. the current message if the current message is deleted.  Otherwise it
  659. moves backward to previous messages until a deleted message is found,
  660. and undeletes that message.
  661.    You can usually undo a `d' with a `u' because the `u' moves back to
  662. and undeletes the message that the `d' deleted.  But this does not work
  663. when the `d' skips a few already-deleted messages that follow the
  664. message being deleted; then the `u' command undeletes the last of the
  665. messages that were skipped.  There is no clean way to avoid this
  666. problem.  However, by repeating the `u' command, you can eventually get
  667. back to the message that you intend to undelete.  You can also select a
  668. particular deleted message with `M-p' command, then type `u' to
  669. undelete it.
  670.    A deleted message has the `deleted' attribute, and as a result
  671. `deleted' appears in the mode line when the current message is deleted.
  672. In fact, deleting or undeleting a message is nothing more than adding
  673. or removing this attribute.  *Note Rmail Labels::.
  674. File: emacs,  Node: Rmail Inbox,  Next: Rmail Files,  Prev: Rmail Deletion,  Up: Rmail
  675. Rmail Files and Inboxes
  676. =======================
  677.    Unix places incoming mail for you in a file that we call your
  678. "inbox".  When you start up Rmail, it copies the new messages from your
  679. inbox into your primary mail file, an Rmail file, which also contains
  680. other messages saved from previous Rmail sessions.  It is in this file
  681. that you actually read the mail with Rmail.  This operation is called
  682. "getting new mail".  It can be repeated at any time using the `g' key
  683. in Rmail.  The inbox file name is `/usr/spool/mail/USERNAME' on some
  684. systems (typically Berkeley-derived ones) and `/usr/mail/USERNAME' on
  685. other systems.
  686.    There are three reason for having separate Rmail files and inboxes.
  687.   1. The inbox file format varies between operating systems and
  688.      according to the other mail software in use.  Only one part of
  689.      Rmail needs to know about the alternatives, and it need only
  690.      understand how to convert all of them to Rmail's own format.
  691.   2. The inbox file format usually doesn't provide a place for all the
  692.      information that Rmail records.
  693.   3. It is very cumbersome to access an inbox file without danger of
  694.      losing mail, because it is necessary to interlock with mail
  695.      delivery.  Moreover, different operating systems use different
  696.      interlocking techniques.  The strategy of moving mail out of the
  697.      inbox once and for all into a separate Rmail file avoids the need
  698.      for interlocking in all the rest of Rmail, since only Rmail
  699.      operates on the Rmail file.
  700.    When getting new mail, Rmail first copies the new mail from the inbox
  701. file to the Rmail file; then it saves the Rmail file; then it truncates
  702. the inbox file.  This way, a system crash may cause duplication of mail
  703. between the inbox and the Rmail file, but cannot lose mail.
  704.    Copying mail from an inbox in the system's mailer directory actually
  705. puts it in an intermediate file `~/.newmail'.  This is because the
  706. interlocking is done by a C program that copies to another file.
  707. `~/.newmail' is deleted after mail merging is successful.  If there is
  708. a crash at the wrong time, this file continues to exist and will be
  709. used as an inbox the next time you get new mail.
  710. File: emacs,  Node: Rmail Files,  Next: Rmail Output,  Prev: Rmail Inbox,  Up: Rmail
  711. Multiple Mail Files
  712. ===================
  713.    Rmail operates by default on your "primary mail file", which is named
  714. `~/RMAIL' and receives your incoming mail from your system inbox file.
  715. But you can also have other mail files and edit them with Rmail.  These
  716. files can receive mail through their own inboxes, or you can move
  717. messages into them with explicit Rmail commands (*note Rmail Output::.).
  718. `i FILE RET'
  719.      Read FILE into Emacs and run Rmail on it (`rmail-input').
  720. `M-x set-rmail-inbox-list RET FILES RET'
  721.      Specify inbox file names for current Rmail file to get mail from.
  722.      Merge new mail from current Rmail file's inboxes
  723.      (`rmail-get-new-mail').
  724. `C-u g FILE RET'
  725.      Merge new mail from inbox file FILE.
  726.    To run Rmail on a file other than your primary mail file, you may use
  727. the `i' (`rmail-input') command in Rmail.  This visits the file, puts
  728. it in Rmail mode, and then gets new mail from the file's inboxes if
  729. any.  The file should be in Rmail format.  You can use `M-x
  730. rmail-input' even when not in Rmail.
  731.    The file you read with `i' should usually be a valid Rmail file.  If
  732. it is not, then Rmail tries to decompose it into a stream of messages
  733. in various known formats.  If it succeeds, it converts the whole file to
  734. an Rmail file.
  735.    Each Rmail file can contain a list of inbox file names; you can
  736. specify this list with `M-x set-rmail-inbox-list RET FILES RET'.  The
  737. argument can contain any number of file names, separated by commas.  It
  738. can also be empty, which specifies that this file should have no
  739. inboxes.  Once a list of inboxes is specified, the Rmail file remembers
  740. it permanently until it is explicitly changed.
  741.    If an Rmail file has inboxes, new mail is merged in from the inboxes
  742. when the Rmail file is brought into Rmail, and when you use the `g'
  743. (`rmail-get-new-mail') command.  If the Rmail file specifies no
  744. inboxes, then no new mail is merged in at these times.  As a special
  745. exception, if your primary mail file does not specify any inbox files,
  746. it uses the standard system inbox.
  747.    To merge mail from a file that is not the usual inbox, give the `g'
  748. key a numeric argument, as in `C-u g'.  Then it reads a file name and
  749. merges mail from that file.  The inbox file is not deleted or changed
  750. in any way when `g' with an argument is used.  This is, therefore, a
  751. general way of merging one file of messages into another.
  752. File: emacs,  Node: Rmail Output,  Next: Rmail Labels,  Prev: Rmail Files,  Up: Rmail
  753. Copying Messages Out to Files
  754. =============================
  755. `o FILE RET'
  756.      Append a copy of the current message to the file FILE, writing it
  757.      in Rmail file format (`rmail-output-to-rmail-file').
  758. `C-o FILE RET'
  759.      Append a copy of the current message to the file FILE, writing it
  760.      in Unix mail file format (`rmail-output').
  761.    If an Rmail file has no inboxes, the only way messages get into it is
  762. by means of explicit `o' commands.
  763.    `o' (`rmail-output-to-rmail-file') appends the current message in
  764. Rmail format to the end of the specified file.  This is the best command
  765. to use to move messages between Rmail files.  If the other Rmail file is
  766. currently visited, the copying is done into the other file's Emacs
  767. buffer instead.  You should eventually save it on disk.
  768.    The `C-o' (`rmail-output') command in Rmail appends a copy of the
  769. current message to a specified file, in Unix mail file format.  This is
  770. useful for moving messages into files to be read by other mail
  771. processors that do not understand Rmail format.
  772.    Copying a message with `o' or `C-o' gives the original copy of the
  773. message the `filed' attribute, so that `filed' appears in the mode line
  774. when such a message is current.  If you like to keep just a single copy
  775. of every mail message, set the variable `rmail-delete-after-output' to
  776. `t'; then the `o' and `C-o' commands delete the original message after
  777. copying it.  (You can undelete the original afterward.)
  778.    The variable `rmail-output-file-alist' lets you specify intelligent
  779. defaults for the output file, based on the contents of the current
  780. message.  The value should be a list whose elements have this form:
  781.      (REGEXP . FILENAME)
  782. If there's a match for REGEXP in the current message, then the default
  783. file name for output is FILENAME.  If multiple elements match the
  784. message, the first matching element decides the default file name.
  785.    Normally you should use only `o' to output messages to other Rmail
  786. files, never `C-o'.  But it is also safe if you always use `C-o', never
  787. `o'.  When a file is visited in Rmail, the last message is checked, and
  788. if it is in Unix format, the entire file is scanned and all Unix-format
  789. messages are converted to Rmail format.  (The reason for checking the
  790. last message is that scanning the file is slow and most Rmail files
  791. have only Rmail format messages.)  If you use `C-o' consistently, the
  792. last message is sure to be in Unix format, so Rmail will convert all
  793. messages properly.
  794.    The case where you might want to use `C-o' always, instead of `o'
  795. always, is when you or other users want to append mail to the same file
  796. from other mail processors.  Other mail processors probably do not know
  797. Rmail format but do know Unix format.
  798.    In any case, always use `o' to add to an Rmail file that is being
  799. visited in Rmail.  Adding messages with `C-o' to the actual disk file
  800. will trigger a "simultaneous editing" warning when you ask to save the
  801. Emacs buffer.  The messages you added to the file will then be lost if
  802. you do save the buffer.
  803. File: emacs,  Node: Rmail Labels,  Next: Rmail Reply,  Prev: Rmail Output,  Up: Rmail
  804. Labels
  805. ======
  806.    Each message can have various "labels" assigned to it as a means of
  807. classification.  A label has a name; different names mean different
  808. labels.  Any given label is either present or absent on a particular
  809. message.  A few label names have standard meanings and are given to
  810. messages automatically by Rmail when appropriate; these special labels
  811. are called "attributes".  All other labels are assigned only by users.
  812. `a LABEL RET'
  813.      Assign the label LABEL to the current message (`rmail-add-label').
  814. `k LABEL RET'
  815.      Remove the label LABEL from the current message
  816.      (`rmail-kill-label').
  817. `C-M-n LABELS RET'
  818.      Move to the next message that has one of the labels LABELS
  819.      (`rmail-next-labeled-message').
  820. `C-M-p LABELS RET'
  821.      Move to the previous message that has one of the labels LABELS
  822.      (`rmail-previous-labeled-message').
  823. `C-M-l LABELS RET'
  824.      Make a summary of all messages containing any of the labels LABELS
  825.      (`rmail-summary-by-labels').
  826. Specifying an empty string for one these commands means to use the last
  827. label specified for any of these commands.
  828.    The `a' (`rmail-add-label') and `k' (`rmail-kill-label') commands
  829. allow you to assign or remove any label on the current message.  If the
  830. LABEL argument is empty, it means to assign or remove the same label
  831. most recently assigned or removed.
  832.    Once you have given messages labels to classify them as you wish,
  833. there are two ways to use the labels: in moving and in summaries.
  834.    The command `C-M-n LABELS RET' (`rmail-next-labeled-message') moves
  835. to the next message that has one of the labels LABELS.  The argument
  836. LABELS specifies one or more label names, separated by commas.  `C-M-p'
  837. (`rmail-previous-labeled-message') is similar, but moves backwards to
  838. previous messages.  A preceding numeric argument to either one serves
  839. as a repeat count.
  840.    The command `C-M-l LABELS RET' (`rmail-summary-by-labels') displays
  841. a summary containing only the messages that have at least one of a
  842. specified set of messages.  The argument LABELS is one or more label
  843. names, separated by commas.  *Note Rmail Summary::, for information on
  844. summaries.
  845.    If the LABELS argument to `C-M-n', `C-M-p' or `C-M-l' is empty, it
  846. means to use the last set of labels specified for any of these commands.
  847.    Some labels such as `deleted' and `filed' have built-in meanings and
  848. are assigned to or removed from messages automatically at appropriate
  849. times; these labels are called "attributes".  Here is a list of Rmail
  850. attributes:
  851. `unseen'
  852.      Means the message has never been current.  Assigned to messages
  853.      when they come from an inbox file, and removed when a message is
  854.      made current.  When you start Rmail, it initially shows the first
  855.      message that has this attribute.
  856. `deleted'
  857.      Means the message is deleted.  Assigned by deletion commands and
  858.      removed by undeletion commands (*note Rmail Deletion::.).
  859. `filed'
  860.      Means the message has been copied to some other file.  Assigned by
  861.      the file output commands (*note Rmail Files::.).
  862. `answered'
  863.      Means you have mailed an answer to the message.  Assigned by the
  864.      `r' command (`rmail-reply').  *Note Rmail Reply::.
  865. `forwarded'
  866.      Means you have forwarded the message to other users.  Assigned by
  867.      the `f' command (`rmail-forward').  *Note Rmail Reply::.
  868. `edited'
  869.      Means you have edited the text of the message within Rmail.  *Note
  870.      Rmail Editing::.
  871. `resent'
  872.      Means you have resent the message to other users.  Assigned by the
  873.      command `M-x rmail-resend'.  *Note Rmail Reply::.
  874.    All other labels are assigned or removed only by the user, and have
  875. no standard meaning.
  876.